﻿package mortal.game.view.copy.worldBoss.cellRender
{
    import Message.Game.*;
    import com.mui.controls.*;
    import com.mui.core.*;
    import extend.language.*;
    import flash.display.*;
    import mortal.common.global.*;
    import mortal.game.resource.*;
    import mortal.game.view.common.*;

    public class WorldBossHoleRankCellRender extends GCellRenderer
    {
        private var txtGuild:GTextFiled;
        private var txtHurt:GTextFiled;
        private var txtRank:GTextFiled;
        private var bgRank:GBitmap;

        public function WorldBossHoleRankCellRender()
        {
            this.focusEnabled = false;
            var _loc_1:* = new Bitmap(new BitmapData(1, 1, true, 0));
            this.setStyle("downSkin", _loc_1);
            this.setStyle("overSkin", _loc_1);
            this.setStyle("upSkin", _loc_1);
            this.setStyle("selectedDownSkin", _loc_1);
            this.setStyle("selectedOverSkin", _loc_1);
            this.setStyle("selectedUpSkin", _loc_1);
            return;
        }// end function

        override protected function createDisposedChildrenImpl() : void
        {
            super.createDisposedChildren();
            this.bgRank = UIFactory.bitmap("", 9, 0, this);
            this.txtRank = UIFactory.gTextField(Language.getString(21423), 7, 0, 220, 20, this, GlobalStyle.textFormatBai);
            var _loc_1:Boolean = false;
            this.txtRank.visible = false;
            this.bgRank.visible = _loc_1;
            this.txtGuild = UIFactory.gTextField(Language.getString(21424), 40, 0, 90, 20, this, GlobalStyle.textFormatBai.center());
            this.txtHurt = UIFactory.gTextField(Language.getString(21425), 130, 0, 80, 20, this, GlobalStyle.textFormatLv.center());
            return;
        }// end function

        override protected function disposeImpl(param1:Boolean = true) : void
        {
            super.disposeImpl(param1);
            this.txtGuild = this.txtGuild && this.txtGuild.dispose(param1) ? (null) : (null);
            this.txtHurt = this.txtHurt && this.txtHurt.dispose(param1) ? (null) : (null);
            this.bgRank = this.bgRank && this.bgRank.dispose(param1) ? (null) : (null);
            this.txtRank = this.txtRank && this.txtRank.dispose(param1) ? (null) : (null);
            return;
        }// end function

        override public function set data(param1:Object) : void
        {
            super.data = param1;
            var _loc_2:* = param1 as SWorldBossHurtRankInfo;
            switch(_loc_2.rank)
            {
                case 1:
                {
                    this.txtRank.visible = false;
                    this.bgRank.visible = true;
                    this.bgRank.bitmapData = GlobalClass.getBitmapData(ImagesConst.worldBoss_rank_first);
                    break;
                }
                case 2:
                {
                    this.txtRank.visible = false;
                    this.bgRank.visible = true;
                    this.bgRank.bitmapData = GlobalClass.getBitmapData(ImagesConst.worldBoss_rank_second);
                    break;
                }
                case 3:
                {
                    this.txtRank.visible = false;
                    this.bgRank.visible = true;
                    this.bgRank.bitmapData = GlobalClass.getBitmapData(ImagesConst.worldBoss_rank_third);
                    break;
                }
                default:
                {
                    this.txtRank.visible = true;
                    this.bgRank.visible = false;
                    break;
                    break;
                }
            }
            this.txtGuild.defaultTextFormat = GlobalStyle.textFormatBai.center();
            this.txtHurt.defaultTextFormat = GlobalStyle.textFormatLv.center();
            this.txtGuild.text = _loc_2.guildName;
            this.txtHurt.text = _loc_2.hurt.toString();
            return;
        }// end function

    }
}
